<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">
<Title>Linking Classes Together</Title>
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</HEAD>
<BODY>

    <table style="width: 100%;" cellpadding="1.0px" cellspacing="1.0px">
        <tr class="mainHeadingRow">
            <td>
                <img align="left" src="logo.jpg" alt="Green Bird Software" />
            </td>
            <td>
                <table width="100%">
                    <tr>
                        <td height="120">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <img align="right" src="title_name.jpg" alt="Green Bird Software" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="thickDivBar">
            </td>
        </tr>
    </table>

<H1>Linking Classes</H1>

<P>
Linking classes together is done by using the <I>linking tool</I> from the main toolbar. Once in linking mode, The Uml Designer will remain in linking mode until either the user clicks on the <I>linking tool</I> in the toolbar again to deselect it, or until the user clicks on the main design area but outside of a linkable object. 

<P>
Links are created by first clicking on the source object, and then holding down the left mouse button dragging onto the target object. The Uml Designer will attempt to detect the most appropriate link depending on the type of objects being linked together. Almost every object can be linked together, with only a few exceptions. Notes can be linked to classes, folders, or even to links between classes (which can be used to document the attribute in the class which is the source of the link.) However notes cannot be linked directly to other notes, as it is not clear what the significance of the link would be indicating and would most likely cause confusion to anyone reading the document.

<P>
After the link has been created, double clicking on it will open the link properties. 

<P>
<img src="screenshots\link_props.jpg" />

<P>
Using this window, it is possible to adjust the properties of the link which in turn changes the code that will be generated for the link. There is a portion of the window which shows the example generated code based on the current settings.

<P>
If the <I>Generate Public Property</I> checkbox is checked, then a public property will be generated which passes through to the link data element. This can assist in achieving a better level of encapsulation.

<H3>Multiplicity</H3>

<P>
Using the link properties window, it is possible to adjust the multiplicity of the link being manipulated. With a <I>One-To-One</I> multiplicity, then the attribute generated will simply be a single reference to an object of the destination class. For example:

<pre class="code">
private TargetClass target;

public TargetClass Target
{
    get
    {
        return target;
    }
    set
    {
        target = value;
    }
}
</pre>

<P>
When you select <I>One-To-Many</I> multiplicity, then the generated code will be a list of references to objects of the destination class, rather than a single instance. For example:

<pre class="code">
private List&lt;TargetClass&gt; target = new List&lt;TargetClass&gt;();

public List&lt;TargetClass&gt; Target
{
    get
    {
        return target;
    }
    set
    {
        target = value;
    }
}
</pre>

</BODY>
</HTML>
